#!/bin/sh

location="2232" #Naples FL
year=`date +"%Y"`
month=`date +"%m"`
day=`date +"%d"`

url="http://staging.timeanddate.com/worldclock/astronomy.html?n=$location&month=$month&year=$year&obj=sun&afl=-13&day=$day"

time=`wget "$url" -O- -q|\
  sed 's/<tr class=c0>/\n<tr class=c0>/g'|\
  grep "class=c0"|\
  head -n1|\
  grep PM|\
  sed 's/<\/td><td>/|/g'|\
  cut -d\| -f9|\
  cut -d\< -f1`

echo "Sunset is at $time"